if(!jsx3.lang.Class.forName("tibco.admin.enterpriseAssets.sReg.ServerRegContainer")) {
    jsx3.lang.Class.defineClass("tibco.admin.enterpriseAssets.sReg.ServerRegContainer",
            jsx3.gui.Block,
            [tibco.admin.plugin.PluginContainerInterface],
            function (plugin) {

                plugin.prototype.tabsToLoad = new Object();
                plugin.prototype.allTabs = new Object();
                plugin.instance = null;

                plugin.prototype.getSectionTitle = function(id) {
                }

                plugin.getInstance = function(args) {
                    if(!this.instance) {
                        this.instance = new tibco.admin.enterpriseAssets.sReg.ServerRegContainer();
                    }
                    return this.instance;
                }

                plugin.prototype.getSelectText = function() {
                }

                plugin.prototype.onAfterGetPlugins = function() {
                    this.getChild(0).subscribe(com.gix.gui.TabbedPane.TAB_SELECTED, this, this.loadTab);
                    var iter = this.getPluginList().iterator();
                    if(iter.hasNext()) {
                        var tab = this.addNewTab(iter.next())
                        var parentPane = tab.getContentPane();
                        var lbl = tab.getText();
                        var plugInComponent = this.tabsToLoad[lbl];
                        if(plugInComponent) {
                            plugInComponent.loadComponent(parentPane);
                            delete this.tabsToLoad[lbl];
                        }
                    }
                    while(iter.hasNext()) {
                        this.addNewTab(iter.next())
                    }
                }

                plugin.prototype.addNewTab = function(pluginComponent) {
                    var labelText = pluginComponent.getTabText();
                    var button = this.getChild(0).addTab(labelText);
                    this.tabsToLoad[labelText] = pluginComponent;
                    this.allTabs[labelText] = pluginComponent;
                    return button;
                }

                plugin.prototype.loadTab = function(objEvent) {
                    var parentPane = objEvent.target.getContentPane();
                    var lbl = objEvent.target.getText();
                    var plugInComponent = this.tabsToLoad[lbl];
                    if(plugInComponent) {
                        plugInComponent.loadComponent(parentPane);
                        delete this.tabsToLoad[lbl];
                    }
                    else {
                        plugInComponent = this.allTabs[lbl];
                        if(plugInComponent) {
                            setTimeout(function() {
                                plugInComponent.tabSelected();
                            }, 0);
                        }
                    }
                }

                plugin.prototype.setupPlugin = function(obj) {
                }

                plugin.prototype.initPlugin = function(obj) {
                }

                plugin.prototype.loadMyDetails = function() {
                    if(this.getPluginList().size() == 0) {
                        var preLoad = new jsx3.util.List(0);
                        if(!tibco.admin.enterpriseAssets.sReg.uddi || !tibco.admin.enterpriseAssets.sReg.uddi.UddiServers) {
                            try {
                                tibco.admin.Main.loadClass("tibco/admin/enterpriseAssets/sReg/uddi/UddiServers.js", "tibco.admin");
                                preLoad.add(tibco.admin.enterpriseAssets.sReg.uddi.UddiServers, preLoad.size());
                            }
                            catch(ex) {
                                tibco.admin.Main.logException(ex);
                            }
                        }
                        else {
                            preLoad.add(tibco.admin.enterpriseAssets.sReg.uddi.UddiServers, preLoad.size());
                        }
//                         For this plugin is already registered in database, the following code is required only in static mode.
//                          Suggest to make styles of loading UddiServer and PlcmgrServers consistent.
//                         if (!jsx3.lang.Class.forName("tibco.admin.enterpriseAssets.sReg.plcmgr.PlcmgrServers")){
//                         try {
//                         tibco.admin.Main.loadClass("tibco/admin/enterpriseAssets/sReg/plcmgr/PlcmgrServers.js", "tibco.policymgr");
//                         preLoad.add(tibco.admin.enterpriseAssets.sReg.plcmgr.PlcmgrServers, preLoad.size());
//                         }
//                         catch(ex) {
//                         tibco.admin.Main.logException(ex);
//                         }
//                         }
//                         else {
//                         preLoad.add(tibco.admin.enterpriseAssets.sReg.plcmgr.PlcmgrServers, preLoad.size());
//                         }
                         
                        this.loadPlugins("tibco.admin.enterpriseAssets.sReg.ServerRegistrationPluginInterface", preLoad);
                    }
                    else {
                        this.onAfterGetPlugins();
                    }
                }

                plugin.prototype.tabSelected = function() {
                    var msg = new Object();
                    msg.subject = com.gix.gui.LeftSelectPane.BUTTON_SELECTED;
                    msg.target = this.getChild(0).getSelectedTab();
                    this.loadTab(msg);
                }
            })
            ;

}
